class pet:
    number_of_legs = 0
    name = ""
    
    def sleep(self):
        print "zzz"
    
    def count_legs(self):
        print "I have %s legs" % self.number_of_legs
        
    def my_name(self):
        print "My name is %s." % self.name

class dog(pet):
    def bark(self):
        print "woof"

doug = dog()
doug.name = "Doug"
doug.my_name()
doug.bark()
doug.number_of_legs = 4
print "Doug has %s legs." % doug.number_of_legs
doug.sleep()
doug.count_legs()

nemo = pet()
nemo.name = "Nemo"
nemo.my_name()
nemo.number_of_legs = 0
print "Nemo has %s legs." % nemo.number_of_legs
nemo.count_legs()